<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        /*do while循环   至少执行一次循环体*/


        var num = 3
        do {
            console.log(num)
            num--;
        } while (num > 1)


        //计算 1+2+3....+100
        var total = 0
        var num2 = 1
        do {
            total = total + num2;
            num2++;
        } while (num2 < 101)

        console.log(total)


        /*continue 关键词  */
        for (var i = 0; i < 7; i++) {
            if (i == 3) {
                continue;   //直接结束本次循环  进入下一次循环
            }
            console.log(i);
        }


        /*求 1~100 之间 能被7整除之外的数的和*/
        var sum = 0;
        for (var i = 0; i < +100; i++) {
            if (i % 7 == 0) {
                continue
            }
            sum += i;
        }
        console.log(sum)


        /*break  结束整个循环*/

        for (var i = 0; i < 7; i++) {
            if (i == 4) {
                break;   //直接结束整个循环
            }
            console.log(i)
        }
    </script>
</head>
<body>

</body>
</html>